/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package avenue;

/**
 *
 * @author George
 */

import org.jdesktop.beansbinding.Converter;
public class ProgramConverter extends Converter {

    @Override
    public Object convertForward(Object value) {
       return String.valueOf((Integer)value);
    }

    @Override
    public Object convertReverse(Object value) {
        int value1;
        try {
            value1 = (value == null) ? 0 : Integer.parseInt((String)value);
        } catch (NumberFormatException ex) {
            
            value1 = -1;
        }
        return value1;
    }

}